//****************************************************************************
// @Module        MultiCAN Controller 
// @Filename      CAN.h
//****************************************************************************

#ifndef _CAN_H_
#define _CAN_H_

#include "Typedefs.h"

#define TSR_TME0     ((uint32_t)0x04000000)    /* Transmit mailbox 0 empty */
#define TSR_TME1     ((uint32_t)0x08000000)    /* Transmit mailbox 1 empty */
#define TSR_TME2     ((uint32_t)0x10000000)    /* Transmit mailbox 2 empty */

typedef struct
  {
     ushort usMOCfg;    // message object configuration register
     uword  uwID;       // standard (11-bit)/extended (29-bit) identifier
     uword  uwMask;     // standard (11-bit)/extended (29-bit) mask
     ubyte  ubData[8];  // 8-bit data bytes
     ushort usCounter;  // frame counter
  }CAN_SWObj;

#define  	CP_MASK_EXT_FRAME 0x1FFFFFFF
#define  	CpMacGetExtId(MSG_PTR)           (MSG_PTR)&CP_MASK_EXT_FRAME

//****************************************************************************
// @Prototypes Of Global Functions
//****************************************************************************
void CAN_vInit(uint32 CanBaudRate);

#endif  // ifndef _CAN_H_
